﻿using System;

namespace YArchitech.Temp
{
	public class HYPipeTerminal : HYTerminal, IHYXmlSerial
	{
		public HYPipeTerminal()
		{
			base.Name = "风机盘管";
			this.m_Port = new HYPipeSpecification();
		}

		public HYPipeSpecification Port
		{
			get
			{
				return this.m_Port;
			}
			set
			{
				this.m_Port = value;
			}
		}

		public double Diameter
		{
			get
			{
				return this.m_Port.Diameter;
			}
			set
			{
				this.m_Port.Diameter = value;
			}
		}

		public override void Cal(HYSystemOption option)
		{
			HYPipeSystemOption hypipeSystemOption = option as HYPipeSystemOption;
			double num = base.Resistance * option.ShockFix;
			if (Utility.IsZero(num, 1E-05))
			{
				num = hypipeSystemOption.TerminalLoss * option.ShockFix;
			}
			HYPipeline hostPipeline = this.GetHostPipeline();
			if (hostPipeline == null)
			{
				return;
			}
			hostPipeline.AddAttachedObject(this, base.Name, num, true, 0);
		}

		private HYPipeSpecification m_Port;
	}
}
